//
// Created by Administrator on 2022/11/6.
//

#include <iostream>
#include <vector>
using namespace std;

int main()
{
    vector<int> vint{1,2,3,4,5};
    cout<<vint.at(4)<<endl; // 用at()代替[4],可以检测索引越界异常
    vint.push_back(6);
    for(int i:vint)
        i=99;
    for(int &ri:vint)
        ri=99;
    cout<<vint[0]<<endl;
    for(int i:vint)
        printf("%d ",i);
    printf("\n");
    vint[0]=100;
    cout<<"size:"<<vint.size()<<endl;
}